// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import '@/components/use'
import axios from '@/utils/request'
import VueStorage from 'vue-ls'
import './permission'
import api from  './api'
import store from './store'
import VueCookies from 'vue-cookies'

Vue.use(VueCookies)
Vue.config.productionTip = false
Vue.prototype.$http = axios
Vue.prototype.api = api
Vue.prototype.indexOf = (targetData,originArr,key) => {
  for(let i in originArr){
    if(originArr[i][key] && targetData[key] && originArr[i][key] == targetData[key]){
      return i
    }
  }
  return -1
}
Vue.use(VueStorage,{
  namespace: 'pro__', // key prefix
  name: 'ls', // name variable Vue.[ls] or this.[$ls],
  storage: 'local' // storage name session, local, memory
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
